//按钮点击回调
switch(view_id)
{
	//开始游戏
	case 100:
		room_goto(rmGame);
		show_debug_message("start_btn_click()");
	break;
	
	//地图编辑
	case 101:
		room_goto(rmEditor);
		show_debug_message("map_btn_click()");
	break;
	
	//退出游戏
	case 102:
		show_debug_message("exit_btn_click()");
		game_end();
	break;
	
	//返回上一个房间
	case 103:
		room_goto(rmMenu);
	break;
	
	//重载当前关卡
	case 104:
		with(oMap)
		{
			//下一关
			success = false;

			//地图文件
			map_file_path = "map/screen."+string(level);
			load = false;
		}
	break;
	
	//跳转下一关
	case 105:
		with(oMap)
		{
			//下一关
			success = false;
			level++;
			
			//地图文件
			map_file_path = "map/screen."+string(level);
			load = false;
		}
	break;
	
	//保存地图
	case 106:

	break;
	
	//运行地图
	case 107:
		if(oEditor.visible)
		{
			//隐藏控件
			with(oEditItem)
				view_show = false;
				
			with(oEditor)
				visible = false;
				
			//生成地图
			with(oEditItem)
			if(!is_tool)
			{
				switch(spr)
				{
					case sBox:
						instance_create_depth(x, y, depth, oBox);	
					break;
				
					case sPallet:
						instance_create_depth(x, y, depth, oPallet);	
					break;
				
					case sWall:
						instance_create_depth(x, y, depth, oWall);	
					break;
				
					case sPlayer_down:
						instance_create_depth(x, y, depth, oPlayer);	
					break;
				}
			}
			
			//显示UI
			with(oKeyPad)
				view_show = true;
		}
		else
		{
			//清空object
			with(oPlayer)
				instance_destroy(id);
			with(oBoxFa)
				instance_destroy(id);
			with(oPallet)
				instance_destroy(id);
				
			//显示控件
			with(oEditItem)
				view_show = true;
			
			with(oEditor)
				visible = true;
				
			//隐藏UI
			with(oKeyPad)
				view_show = false;
		}
	break;
}

